package cnhy.salary.domain;

import cnhy.salary.domain.proxy.MonthlyWageProxy;
import com.easy.query.core.proxy.ProxyEntityAvailable;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

import ling.common.DataUtil;
import lombok.Data;
import com.easy.query.core.annotation.*;
import ling.common.domain.entity.*;
import lombok.var;

/**
 * 月工资;
 * @author : He-LiangLiang@Outlook.com
 * @date : 2025-5-26
 */
@ApiModel(value = "月工资",description = "")
@EntityProxy
@Table("pay_monthly_wage")
@Data
public class MonthlyWage extends IdEntity.LongId implements Serializable,Cloneable, ProxyEntityAvailable<MonthlyWage , MonthlyWageProxy> {

    public double wageTotalSetBy(){
        var mitem=this;
        var sum= mitem.getRatioWage()
                +mitem.getFixedWage()
                +mitem.getPieceworkWage()
                +mitem.getOvertimePay()
                +mitem.getMeal()
                +mitem.getPerformance()
                +mitem.getPostWage()
                +mitem.getWorkedDaysWage()
                +mitem.getWorkingAge();
        mitem.setWageTotal(sum);
        return sum;
    }

    /** 实发：总-税费-设备+其他
     *
     * @return
     */
    public double salarySetBy() {
        salary = wageTotal - taxes + other - insurance;
        return salary;
    }
    /**  */
    /*
    @Column(primaryKey = true)
    @ApiModelProperty(value = "",notes = "")
    private Long id ;
    */
    
    /** 时间 */
    @Excel(name = "月份",dateFormat ="yyyy-MM")
    @ApiModelProperty(value = "时间",notes = "")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time ;
     
   
    /**  */
    @ApiModelProperty(value = "",notes = "")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    private Long userId ;
     
   
    /** 员工姓名 */
    @Excel(name = "员工姓名",sort = 9)
    @ApiModelProperty(value = "员工姓名",notes = "")
    @EasyWhereCondition
    private String userName ;
     
   
    /** 产线名称 */
    @ApiModelProperty(value = "产线名称",notes = "")
    @EasyWhereCondition
    private String lineName ;
     
   
    /** 班组名称 */
    @Excel(name = "班组")
    @ApiModelProperty(value = "班组名称",notes = "")
    @EasyWhereCondition
    private String lv2Name ;
     
   
    /** 岗位名称 */
    @Excel(name = "岗位")
    @ApiModelProperty(value = "岗位名称",notes = "")
    private String postName ;
     
   
    /** 系数工资总计 */
    @Excel(name = "系数工资",sort = 10)
    @ApiModelProperty(value = "系数工资总计",notes = "")
    private Double ratioWage =0d;
     
   
    /** 固定工资总计 */
    @Excel(name = "固定工资",sort = 11)
    @ApiModelProperty(value = "固定工资总计",notes = "")
    private Double fixedWage =0d;
     
   
    /** 计件工资总计 */
    @Excel(name = "计件工资",sort =12 )
    @ApiModelProperty(value = "计件工资总计",notes = "")
    private Double pieceworkWage =0d;
     
   
    /** 加班费总计 */
    @Excel(name = "加班费",sort = 13)
    @ApiModelProperty(value = "加班费总计",notes = "")
    private Double overtimePay =0d;
     
   
    /** 工龄工资总计 */
    @Excel(name = "工龄工资",sort = 14)
    @ApiModelProperty(value = "工龄工资总计",notes = "")
    private Double workingAge =0d;
     
   
    /** 餐补 */
    @Excel(name = "餐补",sort = 15)
    @ApiModelProperty(value = "餐补",notes = "")
    private Double meal =0d;
     
   
    /** 岗位补贴 */
    @Excel(name = "岗位补贴",sort = 16)
    @ApiModelProperty(value = "岗位补贴",notes = "")
    private Double postWage =0d;
     
   
    /** 奖罚总计 */
    @Excel(name = "奖惩",sort = 17)
    @ApiModelProperty(value = "奖罚总计",notes = "")
    private Double performance =0d;

    /** 实际出勤天数 */
    @Excel(name = "出勤天数",sort = 18)
    @ApiModelProperty(value = "实际出勤天数",notes = "")
    private Double workedDays ;


    /** 应出勤天数 */
    @Excel(name = "应出勤天数",sort = 19)
    @ApiModelProperty(value = "应出勤天数",notes = "")
    private Double workingDays ;
     
   

     
   
    /** 满勤奖 */
    @Excel(name = "满勤将",sort = 20)
    @ApiModelProperty(value = "满勤奖",notes = "")
    private Double workedDaysWage =0d;
     
   
    /** 应发总计 */
    @Excel(name = "应发",sort = 21)
    @ApiModelProperty(value = "应发总计",notes = "")
    private Double wageTotal =0d;
     
   
    /** 税费 */
    @Excel(name = "税费",sort = 22)
    @ApiModelProperty(value = "税费",notes = "")
    private Double taxes=0d ;
     
   
    /** 其他费用 */
    @Excel(name = "其他",sort = 23)
    @ApiModelProperty(value = "其他费用",notes = "")
    private Double other =0d;
     
   
    /** 社保 */
    @Excel(name = "社保",sort = 24)
    @ApiModelProperty(value = "社保",notes = "")
    private Double insurance =0d;
     
   
    /** 实发薪水 */
    @Excel(name = "实发",sort = 25)
    @ApiModelProperty(value = "实发薪水",notes = "")
    private Double salary ;
     
   
    /** 说明 */
    @ApiModelProperty(value = "说明",notes = "")
    private String remark ;
     
   
    /** 创建时间 */
    @Excel(name = "创建时间",sort = 30,dateFormat = "YYYY-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间",notes = "")
    private Date createdTime ;


    @ApiModelProperty(value = "排序",notes = "")
    private Integer orderNum ;
}